#include "netservice.h"

#include <iostream>

bool NetService::run()
{
    bool l_result(true);
    try {
        IOService().m_service.run();
    }
    catch(std::exception &e) {
        std::cout << "Error : " << e.what() << std::endl;
        l_result = false;
    }
    return l_result;
}

NetService& NetService::IOService()
{
    static NetService __instance;
    return __instance;
}

boost::asio::io_service& NetService::getIOService()
{
    return m_service;
}

NetService::NetService()
    : m_service()
{

}

NetService::~NetService()
{

}

